<?php
/**
 * Created by JetBrains PhpStorm.
 * User: dung
 * Date: 2/12/14
 * Time: 9:32 AM
 * To change this template use File | Settings | File Templates.
 */
?>


<?php
//Function News

function NewsDetail($IDNews){
    $query="SELECT * FROM `dt_news` WHERE new_id=$IDNews";
    return mysql_query($query);

}

function CountNews(){
    $query="SELECT COUNT(new_id) FROM `dt_news`";
    return mysql_query($query);
}

function NewsLists($start){
    $query="SELECT * FROM `dt_news` ORDER BY `new_id` DESC LIMIT $start,10";
    return mysql_query($query);
}

function NewsList(){
    $query="SELECT * FROM `dt_news` ORDER BY `new_id` DESC LIMIT 4";
    return mysql_query($query);
}

?>


<?php
//Function Contacts
function ContactsInsert($name, $email, $contents, $date) {
    $query = "INSERT INTO `dt_contacts` VALUES (NULL, '$name', '$email', '$contents', '$date');";
    mysql_query($query);
}

?>

<?php 
//Function Phone
function PhoneList(){
    $query="SELECT * FROM `dt_phone_connect` ORDER BY `phone_connect_id` DESC LIMIT 4";
    return mysql_query($query);
}

?>

<?php 
//Function Employee
function EmployeeList(){
	$query="SELECT * FROM `dt_employee` ORDER BY RAND() LIMIT 3";
	return mysql_query($query);
}

function EmployeeDetails($id){
	$query="SELECT * FROM `dt_employee` WHERE employee_id=$id";
	return mysql_query($query);
}

function EmployeeLists($start){
    $query="SELECT * FROM `dt_employee` ORDER BY `employee_id` DESC LIMIT $start,10";
    return mysql_query($query);
}

?>


<?php 
//Functions Informations
function HomePage(){
	$query="SELECT * FROM `dt_information` WHERE `group`='home_page'";
	return mysql_query($query);
}

function Footer(){
	$query="SELECT * FROM `dt_information` WHERE `group`='footer'";
	return mysql_query($query);
}

function FooterDetail($id){
	$query="SELECT * FROM `dt_information` WHERE `information_id`=$id";
	return mysql_query($query);
}

function Info(){
    $query="SELECT * FROM `dt_information` WHERE `group`='info'";
    return mysql_query($query);
}
?>

<?php 
//Function Link
function LinkList(){
	$query="SELECT * FROM `dt_link` WHERE `hide/show`=1";
	return mysql_query($query);
}
?>

<?php 
//Function Recruiment
function RecruimentList(){
	$query="SELECT * FROM `dt_recruitment` ORDER BY `date_added` DESC LIMIT 4";
	return mysql_query($query);
}

function RecruitmentDetail($id){
	$query="SELECT * FROM `dt_recruitment` WHERE `recruitment_id`=$id";
	return mysql_query($query);
}
?>